﻿@model IEnumerable<GameSchool.Models.OnTheFlyModels.CourseOverviewItem>

@{
    Layout = null;
}

@if (Model != null)
{
	foreach (var item in Model)
	{
    
    <h3><a href="#">@item.CourseName</a></h3>
    <div>
        <table>
        @{
        var tmp = item.LevelParticipatingInfos.Where(x => x.LevelParticipate.StateType == GameSchool.Extra.CustomTypes.LevelParticipateStateType.Open).FirstOrDefault();
            }

            @if (tmp != null)
            {

                <text>

                <tr>
                <td>
                Núverandi borð:
                </td>
                <td>
                @tmp.Level.LevelName
                </td>
                </tr>

                <tr>
                <td>
                Númer borðs:
                </td>
                <td>
                @tmp.Level.LevelNumber
                </td>
                </tr>

                <tr>
                <td>
                Fjöldi borða:
                </td>
                <td>
                @item.LevelParticipatingInfos.Count()
                </td>
                </tr>

                <tr>
                <td>
                Dagafjöldi:
                </td>
                <td>
                @tmp.Level.DaysToFinish
                </td>
                </tr>


                </text>
            }
        
        <tr>
        <td colspan="2">
        <span>@Html.ActionLink("Skoða námskeið", "DetailsCourse/" + item.CourseId, "Course")</span>
        </td>
        </tr>
        
        </table>

    </div>
    
	}
}                     
